﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;

namespace BLL
{
    public class NhanVienController
    {
        tbNhanVien obj = new tbNhanVien();
        public bool bllKiemTraDN(string manv, string matkhau)
        {
            bool res = false;
            obj.Manv = manv;
            obj.Matkhau = matkhau;
            res = obj.dalKiemTraDN();
            return res;
        }
        public bool bllThemNV(string tennv, string ngaysinh, int gioitinh, string diachi, string sdt, string email, string matkhau)
        {
            bool res = false;
            obj.Tennv = tennv;
            obj.Ngaysinh = ngaysinh;
            obj.Gioitinh = gioitinh;
            obj.Diachi = diachi;
            obj.Sdt = sdt;
            obj.Email = email;
            obj.Matkhau = matkhau;
            res = obj.dalThemNV();
            return res;
        }

        public bool bllSuaNV(string tennv, string ngaysinh, int gioitinh, string diachi, string sdt, string email, string manv)
        {
            bool res = false;
            obj.Tennv = tennv;
            obj.Ngaysinh = ngaysinh;
            obj.Gioitinh = gioitinh;
            obj.Diachi = diachi;
            obj.Sdt = sdt;
            obj.Email = email;
            obj.Manv = manv;
            res = obj.dalSuaNV();
            return res;
        }

        public bool bllXoaNV(string manv)
        {
            bool res = false;
            obj.Manv = manv;
            res = obj.dalXoaNV();
            return res;
        }

        public bool bllTDMatKhau(string manv, string matkhau, string matkhaumoi)
        {
            bool res = false;
            obj.Manv = manv;
            obj.Matkhau = matkhau;
            obj.Matkhaumoi = matkhaumoi;
            res = obj.dalTDMatKhau();
            return res;
        }

        public DataTable bllHienThiNV(string manv)
        {
            obj.Manv = manv;
            return obj.dalHTNhanVien();
        }

   }
}
